home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / ATA.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  53.4 KB  |  1,050 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ATA.p
  3.  
  4.      Contains:    ATA (PC/AT Attachment) Interfaces
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT ATA;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __ATA__}
  28. {$SETC __ATA__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ATAIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __MIXEDMODE__}
  38. {$I MixedMode.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46.  
  47. { This is the structure used for the AT Interface core routines below }
  48.  
  49. CONST
  50.     kATATrap                    = $AAF1;                        {  Manager trap number <This should be defined in Traps.h> }
  51.     kATAPBVers1                    = $01;                            {  parameter block version number 1 }
  52.     kATAPBVers2                    = $02;                            {  parameter block version number for structures }
  53.     kATAPBVers3                    = $03;                            {  parameter block version for ATA times }
  54.     kATADefaultBlockSize        = 512;                            {  default block size }
  55.  
  56. {  Used to determine the presence of traps }
  57.     kFSMTrap                    = $AC;
  58.     mDQEChanged                    = 1;                            {  DQE has changed  }
  59.  
  60. {  Task file definition ••• Error Register ••• }
  61.     bATABadBlock                = 7;                            {  bit number of bad block error bit }
  62.     bATAUncorrectable            = 6;                            {  bit number of uncorrectable error bit }
  63.     bATAMediaChanged            = 5;                            {  bit number of media changed indicator }
  64.     bATAIDNotFound                = 4;                            {  bit number of ID not found error bit }
  65.     bATAMediaChangeReq            = 3;                            {  bit number of media changed request }
  66.     bATACommandAborted            = 2;                            {  bit number of command abort bit }
  67.     bATATrack0NotFound            = 1;                            {  bit number of track not found }
  68.     bATAAddressNotFound            = 0;                            {  bit number of address mark not found }
  69.     mATABadBlock                = $80;                            {  Bad Block Detected }
  70.     mATAUncorrectable            = $40;                            {  Uncorrectable Data Error }
  71.     mATAMediaChanged            = $20;                            {  Media Changed Indicator (for removable) }
  72.     mATAIDNotFound                = $10;                            {  ID Not Found }
  73.     mATAMediaChangeReq            = $08;                            {  Media Change Requested (NOT IMPLEMENTED) }
  74.     mATACommandAborted            = $04;                            {  Aborted Command }
  75.     mATATrack0NotFound            = $02;                            {  Track 0 Not Found }
  76.     mATAAddressNotFound            = $01;                            {  Address Mark Not Found }
  77.  
  78. {  Task file definition ••• Features register ••• }
  79.     bATAPIuseDMA                = 0;                            {  bit number of useDMA bit (ATAPI) }
  80.     mATAPIuseDMA                = $01;
  81.  
  82. {  Task file definition ••• ataTFSDH Register ••• }
  83.     mATAHeadNumber                = $0F;                            {  Head Number (bits 0-3)  }
  84.     mATASectorSize                = $A0;                            {  bit 7=1; bit 5 = 01 (512 sector size) <DP4> }
  85.     mATADriveSelect                = $10;                            {  Drive (0 = master, 1 = slave)  }
  86.     mATALBASelect                = $40;                            {  LBA mode bit (0 = chs, 1 = LBA) }
  87.  
  88. {  Task file definition ••• Status Register ••• }
  89.     bATABusy                    = 7;                            {  bit number of BSY bit }
  90.     bATADriveReady                = 6;                            {  bit number of drive ready bit }
  91.     bATAWriteFault                = 5;                            {  bit number of write fault bit }
  92.     bATASeekComplete            = 4;                            {  bit number of seek complete bit }
  93.     bATADataRequest                = 3;                            {  bit number of data request bit }
  94.     bATADataCorrected            = 2;                            {  bit number of data corrected bit }
  95.     bATAIndex                    = 1;                            {  bit number of index mark }
  96.     bATAError                    = 0;                            {  bit number of error bit }
  97.     mATABusy                    = $80;                            {  Unit is busy }
  98.     mATADriveReady                = $40;                            {  Unit is ready }
  99.     mATAWriteFault                = $20;                            {  Unit has a write fault condition }
  100.     mATASeekComplete            = $10;                            {  Unit seek complete }
  101.     mATADataRequest                = $08;                            {  Unit data request }
  102.     mATADataCorrected            = $04;                            {  Data corrected }
  103.     mATAIndex                    = $02;                            {  Index mark - NOT USED }
  104.     mATAError                    = $01;                            {  Error condition - see error register }
  105.  
  106. {  Task file definition ••• Device Control Register ••• }
  107.     bATADCROne                    = 3;                            {  bit number of always one bit }
  108.     bATADCRReset                = 2;                            {  bit number of reset bit }
  109.     bATADCRnIntEnable            = 1;                            {  bit number of interrupt disable }
  110.     mATADCROne                    = $08;                            {  always one bit }
  111.     mATADCRReset                = $04;                            {  Reset (1 = reset) }
  112.     mATADCRnIntEnable            = $02;                            {  Interrupt Disable(0 = enabled) }
  113.  
  114. {  ATA Command Opcode definition }
  115.     kATAcmdWORetry                = $01;                            {  Without I/O retry option }
  116.     kATAcmdNOP                    = $0000;                        {  NOP operation - media detect }
  117.     kATAcmdRecal                = $0010;                        {  Recalibrate command  }
  118.     kATAcmdRead                    = $0020;                        {  Read command  }
  119.     kATAcmdReadLong                = $0022;                        {  Read Long command }
  120.     kATAcmdWrite                = $0030;                        {  Write command  }
  121.     kATAcmdWriteLong            = $0032;                        {  Write Long }
  122.     kATAcmdWriteVerify            = $003C;                        {  Write verify }
  123.     kATAcmdReadVerify            = $0040;                        {  Read Verify command  }
  124.     kATAcmdFormatTrack            = $0050;                        {  Format Track command  }
  125.     kATAcmdSeek                    = $0070;                        {  Seek command  }
  126.     kATAcmdDiagnostic            = $0090;                        {  Drive Diagnostic command  }
  127.     kATAcmdInitDrive            = $0091;                        {  Init drive parameters command  }
  128.     kATAcmdReadMultiple            = $00C4;                        {  Read multiple }
  129.     kATAcmdWriteMultiple        = $00C5;                        {  Write multiple }
  130.     kATAcmdSetRWMultiple        = $00C6;                        {  Set Multiple for Read/Write Multiple }
  131.     kATAcmdReadDMA                = $00C8;                        {  Read DMA (with retries) }
  132.     kATAcmdWriteDMA                = $00CA;                        {  Write DMA (with retries) }
  133.     kATAcmdMCAcknowledge        = $00DB;                        {  Acknowledge media change - removable }
  134.     kATAcmdDoorLock                = $00DE;                        {  Door lock }
  135.     kATAcmdDoorUnlock            = $00DF;                        {  Door unlock }
  136.     kATAcmdStandbyImmed            = $00E0;                        {  Standby Immediate }
  137.     kATAcmdIdleImmed            = $00E1;                        {  Idle Immediate }
  138.     kATAcmdStandby                = $00E2;                        {  Standby }
  139.     kATAcmdIdle                    = $00E3;                        {  Idle }
  140.     kATAcmdReadBuffer            = $00E4;                        {  Read sector buffer command  }
  141.     kATAcmdCheckPowerMode        = $00E5;                        {  Check power mode command    <04/04/94> }
  142.     kATAcmdSleep                = $00E6;                        {  Sleep }
  143.     kATAcmdWriteBuffer            = $00E8;                        {  Write sector buffer command  }
  144.     kATAcmdWriteSame            = $00E9;                        {  Write same data to multiple sectors }
  145.     kATAcmdDriveIdentify        = $00EC;                        {  Identify Drive command  }
  146.     kATAcmdMediaEject            = $00ED;                        {  Media Eject }
  147.     kATAcmdSetFeatures            = $00EF;                        {  Set Features }
  148.  
  149. {  Set feature command opcodes }
  150.     kATAEnableWriteCache        = $02;                            {         Enable write cache }
  151.     kATASetTransferMode            = $03;                            {         Set transfer mode }
  152.     kATASetPIOMode                = $08;                            {         PIO Flow Control Tx Mode bit }
  153.     kATAEnableECC                = $88;                            {         ECC enable }
  154.     kATAEnableRetry                = $99;                            {         Retry enable }
  155.     kATAEnableReadAhead            = $AA;                            {         Read look-ahead enable }
  156.  
  157. {
  158.   --------------------------------------------------------------------------------
  159.    enums for dealing with device IDs
  160. }
  161.  
  162.     kATABusIDMask                = $000000FF;
  163.     kATADeviceIDMask            = $0000FF00;
  164.     kATADeviceIDClippingMask    = $0000FFFF;
  165.     kMinBusID                    = $00000000;
  166.     kMaxBusID                    = $000000FE;
  167.  
  168.     kATAStartIterateDeviceID    = $FFFF;
  169.     kATAEndIterateDeviceID        = $FF;
  170.  
  171. { -------------------------------------------------------------------------------- }
  172. { Device Register Images  (8 bytes) }
  173.  
  174. TYPE
  175.     ataTaskFilePtr = ^ataTaskFile;
  176.     ataTaskFile = RECORD
  177.         ataTFFeatures:            SInt8;                                    {  <-> Error(R) or ataTFFeatures(W) register image  }
  178.         ataTFCount:                SInt8;                                    {  <-> Sector count/remaining  }
  179.         ataTFSector:            SInt8;                                    {  <-> Sector start/finish  }
  180.         ataTFReserved:            SInt8;                                    {  reserved                     }
  181.         ataTFCylinder:            UInt16;                                    {  <-> ataTFCylinder (Big endian)  }
  182.         ataTFSDH:                SInt8;                                    {  <-> ataTFSDH register image }
  183.         ataTFCommand:            SInt8;                                    {  <-> Status(R) or Command(W) register image  }
  184.     END;
  185.  
  186. {  ATA Manager Function Code Definition }
  187.  
  188. CONST
  189.     kATAMgrNOP                    = $00;                            {  No Operation }
  190.     kATAMgrExecIO                = $01;                            {  Execute ATA I/O }
  191.     kATAMgrBusInquiry            = $03;                            {  Bus Inquiry }
  192.     kATAMgrQRelease                = $04;                            {  I/O Queue Release }
  193.     kATAMgrAbort                = $10;                            {  Abort command }
  194.     kATAMgrBusReset                = $11;                            {  Reset ATA bus }
  195.     kATAMgrRegAccess            = $12;                            {  Register Access }
  196.     kATAMgrDriveIdentify        = $13;                            {  Drive Identify            <DP03/10/94> }
  197.     kATAMgrDriverLoad            = $82;                            {  Load driver from either Media, ROM, etc. }
  198.     kATAMgrDriveRegister        = $85;                            {  Register a driver        <4/18/94> }
  199.     kATAMgrFindDriverRefnum        = $86;                            {  lookup a driver refnum    <4/18/94> }
  200.     kATAMgrRemoveDriverRefnum    = $87;                            {  De-register a driver    <4/18/94> }
  201.     kATAMgrModifyEventMask        = $88;                            {  Modify driver event mask }
  202.     kATAMgrDriveEject            = $89;                            {  Eject the drive        <8/1/94> }
  203.     kATAMgrGetDrvConfiguration    = $8A;                            {  Get device configuration    <8/6/94> }
  204.     kATAMgrSetDrvConfiguration    = $8B;                            {  Set device configuration <8/6/94> }
  205.     kATAMgrGetLocationIcon        = $8C;                            {  Get card location icon    <SM4> }
  206.     kATAMgrManagerInquiry        = $90;                            {  Manager Inquiry }
  207.     kATAMgrManagerInit            = $91;                            {  Manager initialization }
  208.     kATAMgrManagerShutdown        = $92;                            {  Manager ShutDown }
  209.                                                                 {  note: functions 0x93 to 0x97 are reserved }
  210.     kATAMgrFindSpecialDriverRefnum = $98;                        {  lookup a driver refnum; driverloader,notify-all or ROM driver. }
  211.     kATAMgrNextAvailable        = $99;
  212.  
  213. {  used in the ataDrvrFlags field for kATAMgrDriveRegister,kATAMgrRemoveDriverRefnum & kATAMgrFindSpecialDriverRefnum }
  214.     kATANotifyAllDriver            = 0;                            {  Notify-All driver }
  215.     kATADriverLoader            = 1;                            {  Driver loader driver         }
  216.     kATAROMDriver                = 2;                            {  ROM driver }
  217.  
  218. {  'ATAFlags' field of the PB header definition }
  219.     bATAFlagUseConfigSpeed        = 15;                            {  bit number of use default speed flag }
  220.     bATAFlagByteSwap            = 14;                            {  bit number of byte swap flag }
  221.     bATAFlagIORead                = 13;                            {  bit number of I/O read flag }
  222.     bATAFlagIOWrite                = 12;                            {  bit number of I/O write flag }
  223.     bATAFlagImmediate            = 11;                            {  bit number of immediate flag }
  224.     bATAFlagQLock                = 10;                            {  bit number of que lock on error }
  225.     bATAFlagScatterGather1        = 9;                            {  bit number of scatter gather }
  226.     bATAFlagScatterGather0        = 8;                            {  bit numbers of scatter gather }
  227.     bATAFlagUseDMA                = 7;                            {  bit number of use DMA flag }
  228.     bATAFlagProtocol1            = 5;                            {  bit number of scatter gather }
  229.     bATAFlagProtocol0            = 4;                            {  bit numbers of protocol specifier }
  230.     bATAFlagTFRead                = 3;                            {  bit number of register update }
  231.     bATAFlagLEDEnable            = 0;                            {  bit number of LED enable }
  232.     mATAFlagUseConfigSpeed        = $8000;
  233.     mATAFlagByteSwap            = $4000;                        {  Swap data bytes (read - after; write - before) }
  234.     mATAFlagIORead                = $2000;                        {  Read (in) operation }
  235.     mATAFlagIOWrite                = $1000;                        {  Write (out) operation }
  236.     mATAFlagImmediate            = $0800;                        {  Head of Que; Immediate operation }
  237.     mATAFlagQLock                = $0400;                        {  Manager queue lock on error (freeze the queue) }
  238.     mATAFlagScatterGather1        = $0200;
  239.     mATAFlagScatterGather0        = $0100;                        {  Scatter gather enable }
  240.     mATAFlagScatterGathers        = $0300;                        {  host scatter gather type = currently type 1 supported }
  241.     mATAFlagUseDMA                = $80;
  242.     mATAFlagProtocol1            = $20;                            {  ATAPI protocol indicator <06/15/94> }
  243.     mATAFlagProtocol0            = $10;                            {  PCMCIA protocol indicator <06/15/94> }
  244.     mATAFlagProtocols            = $30;                            {  mask for protocol type field    <06/15/94> }
  245.     mATAFlagTFRead                = $08;                            {  update reg block request upon detection of an error }
  246.     mATAFlagLEDEnable            = $01;                            {  socket LED enable }
  247.  
  248.  
  249.  
  250. TYPE
  251.     ataPBHeaderPtr = ^ataPBHeader;
  252.     ataPBHeader = RECORD
  253.                                                                         {  Start of cloned common header ataPBHdr  }
  254.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  255.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  256.         ataPBVers:                SInt8;                                    {  -->: parameter block version number }
  257.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  258.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  259.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  260.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  261.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  262.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  263.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  264.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  265.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  266.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  267.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  268.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  269.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  270.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  271.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  272.                                                                         {  End of cloned common header ataPBHdr }
  273.     END;
  274.  
  275. {  data request entry structure (16 bytes) }
  276.     IOBlockPtr = ^IOBlock;
  277.     IOBlock = RECORD
  278.         ataPBBuffer:            Ptr;                                    {  -->: Data buffer pointer }
  279.         ataPBByteCount:            UInt32;                                    {  -->: Data transfer length in bytes }
  280.     END;
  281.  
  282. {
  283.    For ATAPI devices the ExtendedPB field is a pointer to the Command Packet
  284.    record which exists of an array of words structured as follows…    <06/15/94>
  285. }
  286.     ATAPICmdPacketPtr = ^ATAPICmdPacket;
  287.     ATAPICmdPacket = RECORD
  288.         atapiPacketSize:        SInt16;                                    {  Size of command packet in bytes    <06/15/94> }
  289.         atapiCommandByte:        ARRAY [0..7] OF SInt16;                    {  The command packet itself    <06/15/94> }
  290.     END;
  291.  
  292. {  Manager parameter block structure (96 bytes) }
  293.     ataIOPBPtr = ^ataIOPB;
  294.     ataIOPB = RECORD
  295.                                                                         {  Start of cloned common header ataPBHdr }
  296.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  297.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  298.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  299.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  300.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  301.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  302.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  303.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  304.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  305.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  306.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  307.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  308.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  309.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  310.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  311.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  312.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  313.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  314.                                                                         {  End of cloned common header ataPBHdr }
  315.         ataPBStatusRegister:    SInt8;                                    {  <--: Last ATA status image }
  316.         ataPBErrorRegister:        SInt8;                                    {  <--: Last ATA error image-valid if lsb of Status set }
  317.         ataPBReserved5:            SInt16;                                    {  Reserved }
  318.         ataPBLogicalBlockSize:    UInt32;                                    {  -->: Blind transfer size per interrupt (Logical block size) }
  319.         ataPBBuffer:            Ptr;                                    {  -->: Data buffer pointer }
  320.         ataPBByteCount:            UInt32;                                    {  -->: Data transfer length in bytes }
  321.         ataPBActualTxCount:        UInt32;                                    {  <--: Actual transfer count }
  322.         ataPBReserved6:            UInt32;                                    {  Reserved }
  323.         ataPBTaskFile:            ataTaskFile;                            {  <->:    Device register images }
  324.         ataPBPacketPtr:            ATAPICmdPacketPtr;                        {  -->: ATAPI packet command block pointer (valid with ATAPI bit set) }
  325.         ataPBReserved7:            ARRAY [0..5] OF SInt16;                    {  Reserved for future expansion }
  326.     END;
  327.  
  328. {  Parameter block structure for bus and Manager inquiry command }
  329. {  Manager parameter block structure }
  330.     ataBusInquiryPtr = ^ataBusInquiry;
  331.     ataBusInquiry = RECORD
  332.                                                                         {  Start of cloned common header ataPBHdr }
  333.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  334.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  335.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  336.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  337.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  338.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  339.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  340.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  341.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  342.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  343.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  344.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  345.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  346.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  347.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  348.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  349.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  350.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  351.                                                                         {  End of cloned common header ataPBHdr }
  352.         ataEngineCount:            UInt16;                                    {  <--: TBD; zero for now }
  353.         ataReserved1:            UInt16;                                    {  Reserved }
  354.         ataDataTypes:            UInt32;                                    {  <--: TBD; zero for now }
  355.         ataIOpbSize:            UInt16;                                    {  <--: Size of ATA IO PB }
  356.         ataMaxIOpbSize:            UInt16;                                    {  <--: TBD; zero for now }
  357.         ataFeatureFlags:        UInt32;                                    {  <--: TBD }
  358.         ataVersionNum:            SInt8;                                    {  <--: Version number for the HBA }
  359.         ataHBAInquiry:            SInt8;                                    {  <--: TBD; zero for now }
  360.         ataReserved2:            UInt16;                                    {  Reserved }
  361.         ataHBAPrivPtr:            UInt32;                                    {  <--: Ptr to HBA private data area }
  362.         ataHBAPrivSize:            UInt32;                                    {  <--: Size of HBA private data area }
  363.         ataAsyncFlags:            UInt32;                                    {  <--: Event capability for callback }
  364.         ataPIOModes:            SInt8;                                    {  <--: PIO modes supported (bit-significant) }
  365.         ataReserved3:            SInt8;                                    {  Reserved }
  366.         ataSingleDMAModes:        SInt8;                                    {  <--: Single Word DMA modes supported (b-sig)     }
  367.         ataMultiDMAModes:        SInt8;                                    {  <--: Multiword DMA modes supported (b-sig) }
  368.         ataReserved4:            ARRAY [0..3] OF UInt32;                    {  Reserved }
  369.         ataReserved5:            ARRAY [0..15] OF SInt8;                    {  TBD }
  370.         ataHBAVendor:            ARRAY [0..15] OF SInt8;                    {  <--: Vendor ID of the HBA }
  371.         ataContrlFamily:        ARRAY [0..15] OF SInt8;                    {  <--: Family of ATA Controller }
  372.         ataContrlType:            ARRAY [0..15] OF SInt8;                    {  <--: Model number of controller }
  373.         ataXPTversion:            ARRAY [0..3] OF SInt8;                    {  <--: version number of XPT }
  374.         ataReserved6:            ARRAY [0..3] OF SInt8;                    {  Reserved }
  375.         ataHBAversion:            NumVersion;                                {  <--: version number of HBA }
  376.         ataHBAslotType:            SInt8;                                    {  <--: type of slot }
  377.         ataHBAslotNum:            SInt8;                                    {  <--: slot number of the HBA }
  378.         ataReserved7:            UInt16;                                    {  Reserved }
  379.         ataReserved8:            UInt32;                                    {  Reserved }
  380.     END;
  381.  
  382. {  Manager parameter block structure }
  383.     ataMgrInquiryPtr = ^ataMgrInquiry;
  384.     ataMgrInquiry = RECORD
  385.                                                                         {  Start of cloned common header ataPBHdr }
  386.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  387.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  388.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  389.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  390.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  391.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  392.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  393.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  394.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  395.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  396.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  397.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  398.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  399.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  400.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  401.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  402.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  403.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  404.                                                                         {  End of cloned common header ataPBHdr }
  405.         ataMgrVersion:            NumVersion;                                {  Manager Version information }
  406.         ataMgrPBVers:            SInt8;                                    {  <--: Manager PB version number supported }
  407.         Reserved1:                SInt8;                                    {  Reserved }
  408.         ataBusCnt:                UInt16;                                    {  <--: Number of ATA buses in the system }
  409.         ataDevCnt:                UInt16;                                    {  <--: Total number of ATA devices detected }
  410.         ataPioModes:            SInt8;                                    {  <--: Maximum Programmed I/O speed mode supported }
  411.         Reserved2:                SInt8;                                    {  Reserved }
  412.         ataIOClkResolution:        UInt16;                                    {  <--: IO Clock resolution in nsec (Not supported) }
  413.         ataSingleDMAModes:        SInt8;                                    {  <--: Single Word DMA modes supported     }
  414.         ataMultiDMAModes:        SInt8;                                    {  <--: Multiword DMA modes supported }
  415.         Reserved:                ARRAY [0..15] OF SInt16;                {  Reserved for future expansion }
  416.     END;
  417.  
  418. {  Parameter block structure for Abort command }
  419. {  Manager parameter block structure }
  420.     ataAbortPtr = ^ataAbort;
  421.     ataAbort = RECORD
  422.                                                                         {  Start of cloned common header ataPBHdr }
  423.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  424.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  425.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  426.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  427.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  428.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  429.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  430.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  431.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  432.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  433.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  434.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  435.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  436.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  437.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  438.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  439.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  440.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  441.                                                                         {  End of cloned common header ataPBHdr }
  442.         ataAbortPB:                ataIOPBPtr;                                {  -->: Parameter block to be aborted }
  443.         Reserved:                ARRAY [0..21] OF SInt16;                {  Reserved for future expansion }
  444.     END;
  445.  
  446. {  Manager parameter block structure }
  447.     ATAEventRecPtr = ^ATAEventRec;
  448.     ATAEventRec = RECORD
  449.         ataEventCode:            UInt16;                                    {  --> ATA event code }
  450.         ataPhysicalID:            UInt16;                                    {  --> Physical drive reference }
  451.         ataDrvrContext:            SInt32;                                    {  Context pointer saved by driver }
  452.         ataMarker:                UInt32;                                    {  Always 'LOAD' }
  453.         ataEventRecVersion:        UInt32;                                    {  Version number of this data structure }
  454.         ataDeviceType:            UInt32;                                    {  Device type on bus (valid for load driver only) }
  455.         ataRefNum:                UInt16;                                    {  RefNum of driver (valid for remove driver only) }
  456.     END;
  457.  
  458. {$IFC TYPED_FUNCTION_POINTERS}
  459.     ATAClientProcPtr = FUNCTION(ataERPtr: ATAEventRecPtr): SInt16;
  460. {$ELSEC}
  461.     ATAClientProcPtr = ProcPtr;
  462. {$ENDC}
  463.  
  464.     ATAClientUPP = UniversalProcPtr;
  465.  
  466. CONST
  467.     uppATAClientProcInfo = $000000E0;
  468.  
  469. FUNCTION NewATAClientProc(userRoutine: ATAClientProcPtr): ATAClientUPP;
  470.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  471.     INLINE $2E9F;
  472.     {$ENDC}
  473.  
  474. FUNCTION CallATAClientProc(ataERPtr: ATAEventRecPtr; userRoutine: ATAClientUPP): SInt16;
  475.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  476.     INLINE $205F, $4E90;
  477.     {$ENDC}
  478. {  Parameter block structure for Driver Register command }
  479. {  Manager parameter block structure }
  480.  
  481. TYPE
  482.     ataDrvrRegisterPtr = ^ataDrvrRegister;
  483.     ataDrvrRegister = RECORD
  484.                                                                         {  Start of cloned common header ataPBHdr }
  485.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  486.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  487.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  488.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  489.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  490.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  491.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  492.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  493.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  494.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  495.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  496.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  497.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  498.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  499.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  500.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  501.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  502.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  503.                                                                         {  End of cloned common header ataPBHdr }
  504.         ataDrvrRefNum:            SInt16;                                    {  <->: Driver reference number }
  505.         ataDrvrFlags:            UInt16;                                    {  -->: 1 = loader driver if ataPBDeviceID = -1 (PB2) }
  506.         ataDeviceNextID:        UInt16;                                    {  <--: used to specified the next drive ID }
  507.         ataDrvrLoadPriv:        SInt16;                                    {  Driver loader private storage }
  508.         ataEventHandler:        ATAClientUPP;                            {  <->: Pointer to ATA event callback routine (PB2) }
  509.         ataDrvrContext:            SInt32;                                    {  <->: Context data saved by driver (PB2) }
  510.         ataEventMask:            SInt32;                                    {  <->: Set to 1 for notification of event (PB2) }
  511.         Reserved:                ARRAY [0..13] OF SInt16;                {  Reserved for future expansion - from [21] (PB2) }
  512.     END;
  513.  
  514. {  Parameter block structure for Modify driver event mask command }
  515.     ataModifyEventMaskPtr = ^ataModifyEventMask;
  516.     ataModifyEventMask = RECORD
  517.                                                                         {  Start of cloned common header ataPBHdr }
  518.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  519.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  520.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  521.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  522.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  523.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  524.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  525.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  526.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  527.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  528.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  529.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  530.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  531.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  532.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  533.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  534.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  535.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  536.                                                                         {  End of cloned common header ataPBHdr }
  537.         ataModifiedEventMask:    SInt32;                                    {  -->: new event mask value }
  538.         Reserved:                ARRAY [0..21] OF SInt16;                {  Reserved for future expansion }
  539.     END;
  540.  
  541. {  'ataRegMask' field of the ataRegAccess definition }
  542.  
  543. CONST
  544.     bATAAltSDevCValid            = 14;                            {  bit number of alternate status/device cntrl valid bit }
  545.     bATAStatusCmdValid            = 7;                            {  bit number of status/command valid bit }
  546.     bATASDHValid                = 6;                            {  bit number of ataTFSDH valid bit }
  547.     bATACylinderHiValid            = 5;                            {  bit number of cylinder high valid bit }
  548.     bATACylinderLoValid            = 4;                            {  bit number of cylinder low valid bit }
  549.     bATASectorNumValid            = 3;                            {  bit number of sector number valid bit }
  550.     bATASectorCntValid            = 2;                            {  bit number of sector count valid bit }
  551.     bATAErrFeaturesValid        = 1;                            {  bit number of error/features valid bit }
  552.     bATADataValid                = 0;                            {  bit number of data valid bit }
  553.     mATAAltSDevCValid            = $4000;                        {  alternate status/device control valid }
  554.     mATAStatusCmdValid            = $80;                            {  status/command valid }
  555.     mATASDHValid                = $40;                            {  ataTFSDH valid }
  556.     mATACylinderHiValid            = $20;                            {  cylinder high valid }
  557.     mATACylinderLoValid            = $10;                            {  cylinder low valid }
  558.     mATASectorNumValid            = $08;                            {  sector number valid }
  559.     mATASectorCntValid            = $04;                            {  sector count valid }
  560.     mATAErrFeaturesValid        = $02;                            {  error/features valid }
  561.     mATADataValid                = $01;                            {  data valid }
  562.  
  563. {  Parameter block structure for device register access command }
  564.  
  565. TYPE
  566.     ataRegValueUnionPtr = ^ataRegValueUnion;
  567.     ataRegValueUnion = RECORD
  568.         CASE INTEGER OF
  569.         0: (
  570.             ataByteRegValue:    SInt8;                                    {  <->: Byte register value read or to be written }
  571.             );
  572.         1: (
  573.             ataWordRegValue:    UInt16;                                    {  <->: Word register value read or to be written }
  574.             );
  575.     END;
  576.  
  577. {  Manager parameter block structure }
  578.     ataRegAccessPtr = ^ataRegAccess;
  579.     ataRegAccess = RECORD
  580.                                                                         {  Start of cloned common header ataPBHdr }
  581.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  582.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  583.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  584.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  585.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  586.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  587.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  588.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  589.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  590.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  591.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  592.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  593.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  594.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  595.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  596.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  597.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  598.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  599.                                                                         {  End of cloned common header ataPBHdr }
  600.         ataRegSelect:            UInt16;                                    {  -->: Device Register Selector }
  601.                                                                         {             DataReg            0     }
  602.                                                                         {             ErrorReg(R) or FeaturesReg(W)    1 }
  603.                                                                         {             SecCntReg        2 }
  604.                                                                         {             SecNumReg        3 }
  605.                                                                         {             CylLoReg        4 }
  606.                                                                         {             CylHiReg        5 }
  607.                                                                         {             SDHReg            6 }
  608.                                                                         {             StatusReg(R) or CmdReg(W)        7 }
  609.                                                                         {             AltStatus(R) or DevCntr(W)    0E }
  610.         ataRegValue:            ataRegValueUnion;
  611.                                                                         {  Following fields are valid only if ataRegSelect = 0xFFFF }
  612.         ataRegMask:                UInt16;                                    {  -->: mask for register(s) to update }
  613.                                                                         {         bit 0 : data register valid }
  614.                                                                         {         bit 1 : error/feaures register valid }
  615.                                                                         {         bit 2 : sector count register valid }
  616.                                                                         {         bit 3 : sector number register valid }
  617.                                                                         {         bit 4 : cylinder low register valid }
  618.                                                                         {         bit 5 : cylinder high register valid }
  619.                                                                         {         bit 6 : ataTFSDH register valid }
  620.                                                                         {         bit 7 : status/command register valid }
  621.                                                                         {         bits 8 - 13 : reserved (set to 0) }
  622.                                                                         {         bit 14: alternate status / device control reg valid }
  623.                                                                         {          bit 15: reserved (set to 0) }
  624.         ataRegisterImage:        ataTaskFile;                            {  <->: register images }
  625.         ataAltSDevCReg:            SInt8;                                    {  <->: Alternate status(R) or Device Control(W) register image }
  626.         Reserved3:                SInt8;                                    {  Reserved }
  627.         Reserved:                ARRAY [0..15] OF SInt16;                {  Reserved for future expansion }
  628.     END;
  629.  
  630. {  Manager parameter block structure    <DP03/10/94> }
  631.     ataIdentifyPtr = ^ataIdentify;
  632.     ataIdentify = RECORD
  633.                                                                         {  Start of cloned common header ataPBHdr }
  634.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  635.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  636.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  637.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  638.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  639.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  640.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  641.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  642.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  643.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  644.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  645.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  646.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  647.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  648.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  649.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  650.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  651.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  652.                                                                         {  End of cloned common header ataPBHdr }
  653.         Reserved1:                ARRAY [0..3] OF UInt16;                    {  Reserved.  These are used internally by the Manager }
  654.         ataPBBuffer:            Ptr;                                    {  Buffer for the identify data (512 bytes) }
  655.         Reserved2:                ARRAY [0..11] OF UInt16;                {  Used internally by the ATA Manager }
  656.         Reserved3:                ARRAY [0..5] OF SInt16;                    {  Reserved for future expansion }
  657.     END;
  658.  
  659. {  'ataConfigSetting' field of the Get/Set Device Configuration definition <8/6/94> }
  660.  
  661. CONST
  662.     ATAPIpacketDRQ_bit            = 6;                            {  bit number of ATAPI command packet DRQ option }
  663.     ATAPIpacketDRQ                = $40;                            {  ATAPI command packet DRQ option }
  664.  
  665. {  atapcValid field definition }
  666.     bATApcAccessMode            = 0;
  667.     bATApcVcc                    = 1;
  668.     bATApcVpp1                    = 2;
  669.     bATApcVpp2                    = 3;
  670.     bATApcStatus                = 4;
  671.     bATApcPin                    = 5;
  672.     bATApcCopy                    = 6;
  673.     bATApcConfigIndex            = 7;
  674.     bATApcLockUnlock            = 15;
  675.     mATApcAccessMode            = $01;
  676.     mATApcVcc                    = $02;
  677.     mATApcVpp1                    = $04;
  678.     mATApcVpp2                    = $08;
  679.     mATApcStatus                = $10;
  680.     mATApcPin                    = $20;
  681.     mATApcCopy                    = $40;
  682.     mATApcConfigIndex            = $80;
  683.     mATApcLockUnlock            = $8000;
  684.  
  685. {  Device physical type & socket type indicator definition }
  686.     kATADeviceUnknown            = $00;                            {  no device or type undetermined }
  687.     kATADeviceATA                = $01;                            {  traditional ATA protocol device <7/29/94> }
  688.     kATADeviceATAPI                = $02;                            {  ATAPI protocol device    <7/29/94> }
  689.     kATADeviceReserved            = $03;                            {  reserved by Apple (was PCMCIA) }
  690.  
  691.     kATASocketInternal            = $01;                            {  Internal ATA socket }
  692.     kATASocketMB                = $02;                            {  Media Bay socket }
  693.     kATASocketPCMCIA            = $03;                            {  PCMCIA socket }
  694.  
  695. {  reserved words at the end of the devConfig structure }
  696.     kATAConfigReserved            = 7;                            {  number of reserved words at the end }
  697.  
  698. {
  699.    Get/Set Device Configuration parameter block structure <8/6/94>
  700.    Manager parameter block structure
  701. }
  702.  
  703. TYPE
  704.     ataDevConfigurationPtr = ^ataDevConfiguration;
  705.     ataDevConfiguration = RECORD
  706.                                                                         {  Start of cloned common header ataPBHdr }
  707.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  708.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  709.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  710.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  711.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  712.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  713.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  714.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  715.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  716.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  717.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  718.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  719.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  720.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  721.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  722.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  723.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  724.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  725.                                                                         {  End of cloned common header ataPBHdr }
  726.         ataConfigSetting:        SInt32;                                    {  <->: Configuration setting }
  727.                                                                         {       Bits 3 - 0: Reserved }
  728.                                                                         {       Bit 4: Reserved (allowLBAAccess) }
  729.                                                                         {       Bit 5: Reserved (allowRWMultiple) }
  730.                                                                         {       Bit 6: ATAPIpacketDRQ }
  731.                                                                         {         1 = Check for Interrupt DRQ on ATAPI command packet DRQ }
  732.                                                                         {         0 = Default: Check only for the assertion of command packet DRQ }
  733.                                                                         {       Bits 31 - 7: Reserved }
  734.         ataPIOSpeedMode:        SInt8;                                    {  <->: Device access speed in PIO Mode }
  735.         Reserved3:                SInt8;                                    {  Reserved to force word alignment }
  736.         atapcValid:                UInt16;                                    {  <->: Set when pcXXX fields are valid (atapcAccessMode - atapcConfigIndex) }
  737.                                                                         {         bit 0 - atapcAccessMode field valid, when set }
  738.                                                                         {         bit 1 - atapcVcc field valid, when set }
  739.                                                                         {         bit 2 - atapcVpp1 field valid, when set }
  740.                                                                         {         bit 3 - atapcVpp2 field valid, when set }
  741.                                                                         {         bit 4 - atapcStatus field valid, when set }
  742.                                                                         {         bit 5 - atapcPin field valid, when set }
  743.                                                                         {         bit 6 - atapcCopy field valid, when set }
  744.                                                                         {         bit 7 - atapcConfigIndex field valid, when set }
  745.                                                                         {         bits 14-8 - Reserved }
  746.                                                                         {         bit 15 - device lock/unlock request (write only) }
  747.         ataRWMultipleCount:        UInt16;                                    {  Reserved for future (not supported yet) }
  748.         ataSectorsPerCylinder:    UInt16;                                    {  Reserved for future (not supported yet) }
  749.         ataHeads:                UInt16;                                    {  Reserved for future (not supported yet) }
  750.         ataSectorsPerTrack:        UInt16;                                    {  Reserved for future (not supported yet) }
  751.         ataSocketNumber:        UInt16;                                    {  <--: Socket number used by the CardServices }
  752.                                                                         {         0xFF = socket number invalid (Not a CardServices device) }
  753.                                                                         {         other = socket number of the device }
  754.         ataSocketType:            SInt8;                                    {  <--: Specifies the socket type (get config only) }
  755.                                                                         {         00 = Unknown socket }
  756.                                                                         {          01 = Internal ATA bus }
  757.                                                                         {         02 = Media Bay }
  758.                                                                         {         03 = PCMCIA }
  759.         ataDeviceType:            SInt8;                                    {  <--: Specifies the device type (get config only) }
  760.                                                                         {         00 = Unknown device }
  761.                                                                         {         01 = standard ATA device (HD) }
  762.                                                                         {         02 = ATAPI device }
  763.                                                                         {         03 = PCMCIA ATA device }
  764.         atapcAccessMode:        SInt8;                                    {  <->: Access mode: Memory vs. I/O (PCMCIA only) }
  765.         atapcVcc:                SInt8;                                    {  <->: Voltage in tenths of a volt (PCMCIA only) }
  766.         atapcVpp1:                SInt8;                                    {  <->: Voltage in tenths of a volt (PCMCIA only) }
  767.         atapcVpp2:                SInt8;                                    {  <->: Voltage in tenths of a volt (PCMCIA only) }
  768.         atapcStatus:            SInt8;                                    {  <->: Card Status register setting (PCMCIA only) }
  769.         atapcPin:                SInt8;                                    {  <->: Card Pin register setting (PCMCIA only) }
  770.         atapcCopy:                SInt8;                                    {  <->: Card Socket/Copy register setting (PCMCIA only) }
  771.         atapcConfigIndex:        SInt8;                                    {  <->: Card Option register setting (PCMCIA only) }
  772.         ataSingleDMASpeed:        SInt8;                                    {  <->: Single Word DMA Timing Class }
  773.         ataMultiDMASpeed:        SInt8;                                    {  <->: Multiple Word DMA Timing Class }
  774.         ataPIOCycleTime:        UInt16;                                    {  <->:Cycle time for PIO mode }
  775.         ataMultiCycleTime:        UInt16;                                    {  <->:Cycle time for Multiword DMA mode }
  776.         Reserved1:                ARRAY [0..6] OF UInt16;                    {  Reserved for future }
  777.     END;
  778.  
  779. {  Get Card Location Icon/Text    <SM4> }
  780.  
  781. CONST
  782.     kATALargeIconHFS            = $0001;                        {  Large B&W icon with mask (HFS) }
  783.     kATALargeIconProDOS            = $0081;                        {  Large B&W icon with mask (ProDOS) }
  784.  
  785. {  Manager parameter block structure }
  786.  
  787. TYPE
  788.     ataLocationDataPtr = ^ataLocationData;
  789.     ataLocationData = RECORD
  790.                                                                         {  Start of cloned common header ataPBHdr }
  791.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  792.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  793.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  794.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  795.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  796.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  797.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  798.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  799.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  800.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  801.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  802.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  803.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  804.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  805.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  806.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  807.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  808.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  809.                                                                         {  End of cloned common header ataPBHdr }
  810.         ataIconType:            SInt16;                                    {  -->: icon type specifier }
  811.                                                                         {          1 = Large B&W icon with mask (256 bytes) }
  812.                                                                         {         0x81 = Same as 1, but ProDOS icon }
  813.         ataIconReserved:        SInt16;                                    {  Reserved to be longword aligned }
  814.         ataLocationIconPtr:        Ptr;                                    {  -->: Icon Data buffer pointer }
  815.         ataLocationStringPtr:    Ptr;                                    {  -->: Icon String buffer pointer }
  816.         Reserved1:                ARRAY [0..17] OF UInt16;                {  Reserved for future }
  817.     END;
  818.  
  819. {  ataOSType available }
  820.  
  821. CONST
  822.     kATAddTypeMacOS                = $0001;                        {  Blue Mac O/S ddType value }
  823.  
  824. {  The parameter block definition for all other ATA Manager functions. }
  825.  
  826.  
  827. TYPE
  828.     ataGenericPtr = ^ataGeneric;
  829.     ataGeneric = RECORD
  830.                                                                         {  Start of cloned common header ataPBHdr }
  831.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  832.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  833.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  834.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  835.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  836.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  837.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  838.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  839.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  840.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  841.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  842.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  843.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  844.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  845.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  846.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  847.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  848.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  849.                                                                         {  End of cloned common header ataPBHdr }
  850.         Reserved:                ARRAY [0..23] OF UInt16;                {  Reserved for future }
  851.     END;
  852.  
  853.     ataPBPtr = ^ataPB;
  854.     ataPB = RECORD
  855.         CASE INTEGER OF
  856.         0: (
  857.             ataIOParamBlock:    ataIOPB;                                {  parameter block for I/O }
  858.             );
  859.         1: (
  860.             ataBIParamBlock:    ataBusInquiry;                            {  parameter block for bus inquiry }
  861.             );
  862.         2: (
  863.             ataMIParamBlock:    ataMgrInquiry;                            {  parameter block for Manager inquiry }
  864.             );
  865.         3: (
  866.             ataAbortParamBlock:    ataAbort;                                {  parameter block for abort }
  867.             );
  868.         4: (
  869.             ataDRParamBlock:    ataDrvrRegister;                        {  parameter block for driver register }
  870.             );
  871.         5: (
  872.             ataMEParamBlock:    ataModifyEventMask;                        {  parameter block for event mask modify }
  873.             );
  874.         6: (
  875.             ataRAParamBlock:    ataRegAccess;                            {  parameter block for register access }
  876.             );
  877.         7: (
  878.             ataDIParamBlock:    ataIdentify;                            {  parameter block for drive identify }
  879.             );
  880.         8: (
  881.             ataDCParamBlock:    ataDevConfiguration;                    {  parameter block for device configuration }
  882.             );
  883.         9: (
  884.             ataLDParamBlock:    ataLocationData;                        {  parameter block for location icon data }
  885.             );
  886.                                                                         { ataManagerInit    ataInitParamBlock;        // parameter block for Manager initialization }
  887.                                                                         { ataManagerShutDn    ataSDParamBlock;        // parameter block for Manager shutdown }
  888.                                                                         { ataDrvrLoad        ataDLParamBlock;        // parameter block for Driver loading }
  889.         10: (
  890.             ataGenericParamBlock: ataGeneric;                            {  parameter block for all other functions }
  891.             );
  892.     END;
  893.  
  894. {  The ATA Event codes… }
  895.  
  896. CONST
  897.     kATANullEvent                = $00;                            {  Just kidding -- nothing happened }
  898.     kATAOnlineEvent                = $01;                            {  An ATA device has come online }
  899.     kATAOfflineEvent            = $02;                            {  An ATA device has gone offline }
  900.     kATARemovedEvent            = $03;                            {  An ATA device has been removed from the bus }
  901.     kATAResetEvent                = $04;                            {  Someone gave a hard reset to the drive }
  902.     kATAOfflineRequest            = $05;                            {  Someone requesting to offline the drive }
  903.     kATAEjectRequest            = $06;                            {  Someone requesting to eject the drive }
  904.     kATAUpdateEvent                = $07;                            {  Potential configuration change reported by CardServices <SM4> }
  905.     kATATaskTimeRequest            = $08;                            {  The manager is requesting to be called at Task Time }
  906.     kATALoadDriverNow            = $09;                            {  Load the driver for the given bus immediately }
  907.     kATAPIResetEvent            = $0A;                            {  Someone gave a ATAPI reset to the drive }
  908.                                                                 {  The following describes bit definitions in the eventMask field of ataDrvrRegister }
  909.     bATANullEvent                = $01;                            {  null event bit }
  910.     bATAOnlineEvent                = $02;                            {  online event bit }
  911.     bATAOfflineEvent            = $04;                            {  offline event bit }
  912.     bATARemovedEvent            = $08;                            {  removed event bit }
  913.     bATAResetEvent                = $10;                            {  ATA reset event bit }
  914.     bATAOfflineRequest            = $20;                            {  offline request event bit }
  915.     bATAEjectRequest            = $40;                            {  eject request event bit }
  916.     bATAUpdateEvent                = $80;                            {  configuration update event bit }
  917.     bATAPIResetEvent            = $0400;                        {  ATAPI reset event bit }
  918.  
  919.     kATAEventMarker                = 'LOAD';                        {  Marker for the event data structure }
  920.     kATAEventVersion1            = $00000001;                    {  Version 1 of the event structure }
  921.  
  922.  
  923. TYPE
  924. {$IFC TYPED_FUNCTION_POINTERS}
  925.     ATADispatchProcPtr = FUNCTION(VAR pb: ataPB): OSErr;
  926. {$ELSEC}
  927.     ATADispatchProcPtr = ProcPtr;
  928. {$ENDC}
  929.  
  930.     ATADispatchUPP = UniversalProcPtr;
  931.  
  932. CONST
  933.     uppATADispatchProcInfo = $000000E0;
  934.  
  935. FUNCTION NewATADispatchProc(userRoutine: ATADispatchProcPtr): ATADispatchUPP;
  936.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  937.     INLINE $2E9F;
  938.     {$ENDC}
  939.  
  940. FUNCTION CallATADispatchProc(VAR pb: ataPB; userRoutine: ATADispatchUPP): OSErr;
  941.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  942.     INLINE $205F, $4E90;
  943.     {$ENDC}
  944. FUNCTION ataManager(VAR pb: ataPB): SInt16;
  945.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  946.     INLINE $AAF1;
  947.     {$ENDC}
  948. { Device Error codes: 0xDB42 - 0xDB5F    }
  949.  
  950.  
  951. CONST
  952.     ATABaseErrCode                = -9406;                        {  Base error code - 0xDB42     }
  953.     ioPending                    = 1;                            {  Asynch I/O in progress status }
  954.     AT_NRdyErr                    = -9405;                        {  0xDB43: Drive not Ready  }
  955.     AT_IDNFErr                    = -9404;                        {  0xDB44: ID not found  }
  956.     AT_DMarkErr                    = -9403;                        {  0xDB45: Data mark not found  }
  957.     AT_BadBlkErr                = -9402;                        {  0xDB46: Bad Block  }
  958.     AT_CorDataErr                = -9401;                        {  0xDB47: Data was corrected  }
  959.     AT_UncDataErr                = -9400;                        {  0xDB48: Data was not corrected  }
  960.     AT_SeekErr                    = -9399;                        {  0xDB49: Seek error  }
  961.     AT_WrFltErr                    = -9398;                        {  0xDB4A: Write fault  }
  962.     AT_RecalErr                    = -9397;                        {  0xDB4B: Recalibrate failed  }
  963.     AT_AbortErr                    = -9396;                        {  0xDB4C: Command aborted by drive  }
  964.     AT_MCErr                    = -9394;                        {  0xDB4E: Media Changed error }
  965.     ATAPICheckErr                = -9393;                        {  0xDB4F: ATAPI Check condition <06/15/94> }
  966.                                                                 {  System error codes...Custom Driver Error Codes 0xDB60 - 0xDB6F }
  967.     DRVRCantAllocate            = -9376;                        {  0xDB60: Allocation error during initialization }
  968.     NoATAMgr                    = -9375;                        {  0xDB61: MgrInquiry failed => No ATA Manager }
  969.     ATAInitFail                    = -9374;                        {  0xDB62: Mgr Initialization failed }
  970.     ATABufFail                    = -9373;                        {  0xDB63: Device buffer test failure }
  971.     ATADevUnsupported            = -9372;                        {  0xDB64: Device type not supported }
  972.     ATAEjectDrvErr                = -9371;                        {  0xDB65: Could not eject the drive }
  973.                                                                 {  Manager Error Codes 0xDB70 - 0xDB8F }
  974.     ATAMgrNotInitialized        = -9360;                        {  0xDB70: Mgr has not been initialized }
  975.     ATAPBInvalid                = -9359;                        {  0xDB71: The bus base address couldn't be found }
  976.     ATAFuncNotSupported            = -9358;                        {  0xDB72: An unknown function code specified }
  977.     ATABusy                        = -9357;                        {  0xDB73: Selected device is busy }
  978.     ATATransTimeOut                = -9356;                        {  0xDB74: Transaction timeout detected }
  979.     ATAReqInProg                = -9355;                        {  0xDB75: Channel busy; channel is processing another cmd }
  980.     ATAUnknownState                = -9354;                        {  0xDB76: Device status register reflects an unknown state }
  981.     ATAQLocked                    = -9353;                        {  0xDB77: I/O Queue is locked due to previous I/O error. }
  982.     ATAReqAborted                = -9352;                        {  0xDB78: The I/O queue entry was aborted due to an abort req. }
  983.                                                                 {             or due to Manager shutdown. }
  984.     ATAUnableToAbort            = -9351;                        {  0xDB79: The I/O queue entry could not be aborted. }
  985.     ATAAbortedDueToRst            = -9350;                        {  0xDB7A: Request aborted due to a device reset command. }
  986.     ATAPIPhaseErr                = -9349;                        {  0xDB7B: Unexpected phase - •••IS THIS VALID ERROR??? <06/15/94> }
  987.     ATAPITxCntErr                = -9348;                        {  0xDB7C: Overrun/Underrun condition detected }
  988.     ATANoClientErr                = -9347;                        {  0xDB7D: No client present to handle the event }
  989.     ATAInternalErr                = -9346;                        {  0xDB7E: MagnumOpus returned an error }
  990.     ATABusErr                    = -9345;                        {  0xDB7F: Bus error detected on I/O     }
  991.     AT_NoAddrErr                = -9344;                        {  0xDB80: Invalid AT base adress  }
  992.     DriverLocked                = -9343;                        {  0xDB81: Current driver must be removed before adding another }
  993.     CantHandleEvent                = -9342;                        {  0xDB82: Particular event couldn't be handled (call others) }
  994.     ATAMgrMemoryErr                = -9341;                        {  0xDB83: Manager memory allocation error     }
  995.     ATASDFailErr                = -9340;                        {  0xDB84: Shutdown failure                 }
  996.     ATAXferParamErr                = -9339;                        {  0xDB85: I/O xfer parameters inconsistent  }
  997.     ATAXferModeErr                = -9338;                        {  0xDB86: I/O xfer mode not supported  }
  998.     ATAMgrConsistencyErr        = -9337;                        {  0XDB87: Manager detected internal inconsistency.  }
  999.     ATADmaXferErr                = -9336;                        {  0XDB88: fatal error in DMA side of transfer  }
  1000.                                                                 {  Driver loader error Codes 0xDB90 - 0xDBA5 }
  1001.     ATAInvalidDrvNum            = -9328;                        {  0xDB90: Invalid drive number from event }
  1002.     ATAMemoryErr                = -9327;                        {  0xDB91: Memory allocation error }
  1003.     ATANoDDMErr                    = -9326;                        {  0xDB92: No DDM found on media     }
  1004.     ATANoDriverErr                = -9325;                        {  0xDB93: No driver found on the media     }
  1005.  
  1006. { ------------------------    Version 1 definition -------------------------------    }
  1007.     v1ATABaseErrCode            = $0700;                        {  This needs a home somewhere }
  1008.     v1AT_NRdyErr                = $FFFFF901;                    {  0xF901: -0x1DBE  }
  1009.     v1AT_IDNFErr                = $FFFFF904;                    {  0xF904: -0x1DC0  }
  1010.     v1AT_DMarkErr                = $FFFFF905;                    {  0xF905: -0x1DC0  }
  1011.     v1AT_BadBlkErr                = $FFFFF906;                    {  0xF906: -0x1DC0  }
  1012.     v1AT_CorDataErr                = $FFFFF907;                    {  0xF907: -0x1DC0  }
  1013.     v1AT_UncDataErr                = $FFFFF908;                    {  0xF908: -0x1DC0  }
  1014.     v1AT_SeekErr                = $FFFFF909;                    {  0xF909: -0x1DC0  }
  1015.     v1AT_WrFltErr                = $FFFFF90A;                    {  0xF90A: -0x1DC0  }
  1016.     v1AT_RecalErr                = $FFFFF90B;                    {  0xF90B: -0x1DC0  }
  1017.     v1AT_AbortErr                = $FFFFF90C;                    {  0xF90C: -0x1DC0  }
  1018.     v1AT_NoAddrErr                = $FFFFF90D;                    {  0xF90D: -0x1D8D  }
  1019.     v1AT_MCErr                    = $FFFFF90E;                    {  0xF90E: -0x1DC0 }
  1020.                                                                 {  System error codes...Custom Driver Error Codes }
  1021.     v1DRVRCantAllocate            = -1793;                        {  0xF8FF: -0x1D9F }
  1022.     v1NoATAMgr                    = -1794;                        {  0xF8FE: -0x1D9D }
  1023.     v1ATAInitFail                = -1795;                        {  0xF8FD: -0x1D9B }
  1024.     v1ATABufFail                = -1796;                        {  0xF8FC: -0x1D99 }
  1025.     v1ATADevUnsupported            = -1797;                        {  0xF8FB: -0x1c97 }
  1026.                                                                 {  Manager Error Codes }
  1027.     v1ATAMgrNotInitialized        = -1802;                        {  0xF8F6: -0x1D86 }
  1028.     v1ATAPBInvalid                = -1803;                        {  0xF8F5: -0x1D84 }
  1029.     v1ATAFuncNotSupported        = -1804;                        {  0xF8F4: -0x1D82 }
  1030.     v1ATABusy                    = -1805;                        {  0xF8F3: -0x1D80 }
  1031.     v1ATATransTimeOut            = -1806;                        {  0xF8F2: -0x1D7E }
  1032.     v1ATAReqInProg                = -1807;                        {  0xF8F1: -0x1D7C }
  1033.     v1ATAUnknownState            = -1808;                        {  0xF8F0: -0x1D7A }
  1034.     v1ATAQLocked                = -1809;                        {  0xF8EF: -0x1D78 }
  1035.     v1ATAReqAborted                = -1810;                        {  0xF8EE: -0x1D76 }
  1036.     v1ATAUnableToAbort            = -1811;                        {  0xF8ED: -0x1D74 }
  1037.     v1ATAAbortedDueToRst        = -1812;                        {  0xF8EC: -0x1D72 }
  1038.  
  1039.  
  1040. {$ALIGN RESET}
  1041. {$POP}
  1042.  
  1043. {$SETC UsingIncludes := ATAIncludes}
  1044.  
  1045. {$ENDC} {__ATA__}
  1046.  
  1047. {$IFC NOT UsingIncludes}
  1048.  END.
  1049. {$ENDC}
  1050.